home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / c / tde31.zip / TDEFUNC.H < prev    next >
Text File  |  1993-08-29  |  17KB  |  439 lines

  1. /*
  2.  * New editor name:  TDE, the Thomson-Davis Editor.
  3.  * Author:           Frank Davis
  4.  * Date:             June 5, 1991
  5.  *
  6.  * This modification of Douglas Thomson's code is released into the
  7.  * public domain, Frank Davis.  You may distribute it freely.
  8.  *
  9.  * This file contains all prototypes for every function in tde.  It should
  10.  * be included in every source code module.
  11.  *
  12.  * I'm so stupid, I can't keep up with which functions are used in which
  13.  * files.  Let's gather all prototypes into one file, so I don't have
  14.  * to remember too much.
  15.  */
  16.  
  17.  
  18. /*************************  function prototypes in block.c *************/
  19. int  mark_block( WINDOW * );
  20. int  unmark_block( WINDOW * );
  21. void restore_marked_block( WINDOW *, int );
  22. int  prepare_block( WINDOW *, line_list_ptr, int );
  23. int  pad_dest_line( WINDOW *, file_infos *, line_list_ptr );
  24. int  move_copy_delete_overlay_block( WINDOW * );
  25. void do_line_block( WINDOW *,  WINDOW *,  int,  file_infos *,  file_infos *,
  26.                     line_list_ptr,  line_list_ptr,  line_list_ptr,
  27.                     line_list_ptr,  long,  long,  int * );
  28. void do_stream_block( WINDOW *,  WINDOW *,  int,  file_infos *,
  29.                       file_infos *,  line_list_ptr,  line_list_ptr,
  30.                       line_list_ptr,  line_list_ptr,
  31.                       long,  long,  long,  int,  int,  int,  int * );
  32. void do_box_block( WINDOW *,  WINDOW *,  int,  file_infos *,  file_infos *,
  33.                    line_list_ptr, line_list_ptr,  long,  long, long,
  34.                    long,  long,  int,  int, int,
  35.                    int,  int,  int,  int,  int * );
  36. void load_box_buff( char *, line_list_ptr, int, int, char );
  37. int  copy_buff_2file( WINDOW *, char *, line_list_ptr, int, int, int );
  38. void block_fill( char *, int, int );
  39. void number_block_buff( char *, int, long, int );
  40. void restore_cursors( file_infos * );
  41. int  delete_box_block( WINDOW *, line_list_ptr, int, int );
  42. void check_block( void );
  43. void find_begblock( file_infos * );
  44. void find_endblock( file_infos * );
  45. int  block_write( WINDOW * );
  46. int  block_print( WINDOW * );
  47. int  get_block_fill_char( WINDOW *, int * );
  48. int  get_block_numbers( WINDOW *, long *, long *, int * );
  49. int  block_trim_trailing( WINDOW * );
  50. int  block_email_reply( WINDOW * );
  51. int  block_convert_case( WINDOW * );
  52. void upper_case( text_ptr, size_t );
  53. void lower_case( text_ptr, size_t );
  54. void rot13( text_ptr, size_t );
  55. void fix_uue( text_ptr, size_t );
  56. void strip_hi( text_ptr, size_t );
  57. /************************************************************************/
  58.  
  59.  
  60. /**********************  function prototypes in console.c  **************/
  61. void video_config( struct vcfg *cfg );
  62. int  getkey( void );
  63. int  waitkey( int );
  64. int  getfunc( int );
  65. int  two_key( WINDOW * );
  66. void flush_keyboard( void );
  67. void xygoto( int, int );
  68. void update_line( WINDOW * );
  69. void c_output( int, int, int, int );
  70. void s_output( char far *, int, int, int );
  71. void eol_clear( int, int, int );
  72. void window_eol_clear( WINDOW *, int );
  73. void hlight_line( int, int, int, int );
  74. void cls( void );
  75. void set_cursor_size( int );
  76. void set_overscan_color( int );
  77. void save_screen_line( int, int, char * );
  78. void restore_screen_line( int, int, char * );
  79. /************************************************************************/
  80.  
  81.  
  82. /*************************  function prototypes in diff.c  **************/
  83. int  define_diff( WINDOW * );
  84. int  repeat_diff( WINDOW * );
  85. int  differ( int, int, int );
  86. int  skip_leading_space( text_ptr, int );
  87. line_list_ptr skip_eol( line_list_ptr, int *, int *, long *, long * );
  88. void show_diff_window( WINDOW * );
  89. int  verify_number( char *, int * );
  90. int  verify_letter( char *, int *, WINDOW ** );
  91. /************************************************************************/
  92.  
  93.  
  94. /*************************  function prototypes in dirlist.c *************/
  95. int  dir_help( WINDOW * );
  96. void far *my_calloc( unsigned, unsigned );
  97. int  validate_path( char *, char * );
  98. int  list_and_pick( char *, char *, WINDOW * );
  99. void setup_directory_window( DIRECTORY *, int );
  100. void recalculate_dir( DIRECTORY *, FTYPE *, int );
  101. void write_directory_list( FTYPE *, DIRECTORY );
  102. int  select_file( FTYPE *, char *, DIRECTORY * );
  103. void shell_sort( FTYPE *, int );
  104. /************************************************************************/
  105.  
  106.  
  107. /*************************  function prototypes in ed.c *****************/
  108. int  insert_newline( WINDOW * );
  109. int  insert_overwrite( WINDOW * );
  110. int  join_line( WINDOW * );
  111. int  dup_line( WINDOW * );
  112. int  word_delete( WINDOW * );
  113. int  back_space( WINDOW * );
  114. int  line_kill( WINDOW * );
  115. int  char_del_under( WINDOW * );
  116. int  eol_kill( WINDOW * );
  117. int  undo_line( WINDOW * );
  118. int  undo( WINDOW * );
  119. int  beg_next_line( WINDOW *window );
  120. int  next_line( WINDOW *window );
  121. int  home( WINDOW * );
  122. int  goto_eol( WINDOW * );
  123. int  goto_top( WINDOW * );
  124. int  goto_bottom( WINDOW * );
  125. int  set_tabstop( WINDOW * );
  126. void show_line_col( WINDOW * );
  127. void show_asterisk( WINDOW * );
  128. int  toggle_overwrite( WINDOW * );
  129. int  toggle_smart_tabs( WINDOW * );
  130. int  toggle_indent( WINDOW * );
  131. int  set_left_margin( WINDOW * );
  132. int  set_right_margin( WINDOW * );
  133. int  set_paragraph_margin( WINDOW * );
  134. int  toggle_ww( WINDOW * );
  135. int  toggle_crlf( WINDOW * );
  136. int  toggle_trailing( WINDOW * );
  137. int  toggle_z( WINDOW * );
  138. int  toggle_eol( WINDOW * );
  139. int  toggle_search_case( WINDOW * );
  140. int  toggle_sync( WINDOW * );
  141. int  toggle_ruler( WINDOW * );
  142. int  toggle_tabinflate( WINDOW * );
  143. void sync( WINDOW * );
  144. void editor( void );
  145. void display_dirty_windows( WINDOW * );
  146. void show_dirty_window( WINDOW * );
  147. /************************************************************************/
  148.  
  149.  
  150. /*************************  function prototypes in file.c  **************/
  151. int  hw_fattrib( char * );
  152. int  change_mode( char *, int );
  153. int  write_file( char *, int, file_infos *, long, long, int );
  154. int  hw_save( char *, file_infos *, long, long, int );
  155. int  hw_append( char *, file_infos *, long, long, int );
  156. int  load_file( char *, file_infos *, int *, int );
  157. void insert_node( file_infos *, line_list_ptr, line_list_ptr );
  158. int  show_file_2big( char *, int, line_list_ptr, text_ptr );
  159. int  backup_file( WINDOW * );
  160. int  edit_file( char *, int, int );
  161. int  edit_another_file( WINDOW * );
  162. int  edit_next_file( WINDOW * );
  163. int  search_and_seize( WINDOW * );
  164. int  attempt_edit_display( char *, int, int, int );
  165. void make_backup_fname( file_infos * );
  166. int  file_file( WINDOW * );
  167. int  save_file( WINDOW * );
  168. int  save_backup( WINDOW * );
  169. int  write_to_disk( WINDOW *, char * );
  170. int  save_as_file( WINDOW * );
  171. int  change_fattr( WINDOW * );
  172. int  get_fattr( char far *, int * );
  173. int  set_fattr( char far *, int );
  174. int  get_current_directory( char far *, int );
  175. int  set_current_directory( char far * );
  176. /************************************************************************/
  177.  
  178.  
  179. /*************************  function prototypes in findrep.c ************/
  180. int  get_replacement_flags( int );
  181. int  ask_replace( WINDOW *, int * );
  182. int  ask_wrap_replace( WINDOW *, int * );
  183. void do_replace( WINDOW *, int );
  184. int  find_string( WINDOW * );
  185. void build_boyer_array( void );
  186. void build_forward_skip( boyer_moore_type * );
  187. void build_backward_skip( boyer_moore_type * );
  188. int  calculate_forward_md2( char *, int );
  189. int  calculate_backward_md2( char *, int );
  190. line_list_ptr forward_boyer_moore_search( WINDOW *, long *, int * );
  191. line_list_ptr search_forward( line_list_ptr, long *, unsigned * );
  192. line_list_ptr backward_boyer_moore_search( WINDOW *, long *, int * );
  193. line_list_ptr search_backward( line_list_ptr, long *, unsigned * );
  194. void show_search_message( int, int );
  195. void bin_offset_adjust( WINDOW *, long );
  196. void find_adjust( WINDOW *, line_list_ptr, long, int );
  197. int  replace_string( WINDOW * );
  198. int  replace_and_display( WINDOW *, line_list_ptr, long, int, int *, int *, int );
  199. line_list_ptr scan_forward( long *, int *, line_list_ptr, char, char, int * );
  200. line_list_ptr scan_backward( long *, int *, line_list_ptr, char, char, int * );
  201. int  match_pair( WINDOW * );
  202. /************************************************************************/
  203.  
  204.  
  205. /*************************  function prototypes in hwind.c **************/
  206. void get_date( int *, int *, int *, int * );
  207. void get_time( int *, int *, int *, int * );
  208. void show_end_mem( void );
  209. void show_end_text( WINDOW * );
  210. void show_modes( void );
  211. void show_file_count( int );
  212. void show_window_count( int );
  213. void show_avail_mem( void );
  214. void show_tab_modes( void );
  215. void show_indent_mode( void );
  216. void show_search_case( void );
  217. void show_sync_mode( void );
  218. void show_wordwrap_mode( void );
  219. void show_trailing( void );
  220. void show_control_z( void );
  221. void show_insert_mode( void );
  222. void my_scroll_down( WINDOW * );
  223. void combine_strings( char *, char *, char *, char * );
  224. void make_ruler( WINDOW * );
  225. void show_ruler( WINDOW * );
  226. void show_ruler_char( WINDOW * );
  227. void show_ruler_pointer( WINDOW * );
  228. void show_all_rulers( void );
  229. /************************************************************************/
  230.  
  231.  
  232. /************************  function prototypes in macro.c  **************/
  233. int  record_on_off( WINDOW * );
  234. void record_keys( int );
  235. void show_avail_strokes( void );
  236. int  save_strokes( WINDOW * );
  237. int  load_strokes( WINDOW * );
  238. int  clear_macros( WINDOW * );
  239. void connect_macros( void );
  240. int  play_back( WINDOW * );
  241. int  push_macro_stack( int );
  242. int  pop_macro_stack( int * );
  243. int  pause( WINDOW * );
  244. /************************************************************************/
  245.  
  246.  
  247. /*************************  function prototypes in main.c  **************/
  248. void main( int, char *[] );
  249. void error( int, int, char * );
  250. #if defined( __MSC__ )
  251. void interrupt far harmless( void );
  252. void interrupt far ctrl_break( void );
  253. #else
  254. static int harmless( void );
  255. #endif
  256. void terminate( void );
  257. void initialize( void );
  258. void hw_initialize( void );
  259. int  get_help( WINDOW * );
  260. void show_credits( void );
  261. /************************************************************************/
  262.  
  263.  
  264. /*************************  function prototypes in port.c *************/
  265. void far * my_malloc( size_t, int * );
  266. void my_free( void far * );
  267. int  my_findfirst( DTA far *, char far *, int );
  268. int  my_findnext( DTA far * );
  269. /************************************************************************/
  270.  
  271.  
  272. /*************************  function prototypes in regx.c *************/
  273. int  find_regx( WINDOW * );
  274. line_list_ptr forward_regx_search( WINDOW *, long *, int * );
  275. line_list_ptr regx_search_forward( line_list_ptr, long *, int * );
  276. line_list_ptr backward_regx_search( WINDOW *, long *, int * );
  277. line_list_ptr regx_search_backward( line_list_ptr, long *, int * );
  278. int  nfa_match( void );
  279. int  build_nfa( void );
  280. int  expression( void );
  281. int  term( void );
  282. int  factor( void );
  283. int  escape_char( int );
  284. void emit_cnode( int, int, int, int );
  285. void emit_nnode( int, int, int, int, int );
  286. int  put_dq( int );
  287. int  push_dq( int );
  288. int  pop_dq( void );
  289. int  dequeempty( void );
  290. void init_nfa( void );
  291. void regx_error( char * );
  292. int  separator( int );
  293. int  Kleene_star( int );
  294. int  letter( int );
  295. /**********************************************************************/
  296.  
  297.  
  298. /*************************  function prototypes in sort.c *************/
  299. int  sort_box_block( WINDOW *window );
  300. void quick_sort_block( long, long, line_list_ptr, line_list_ptr );
  301. void insertion_sort_block( long, long, line_list_ptr );
  302. void load_pivot( line_list_ptr );
  303. int  compare_pivot( line_list_ptr );
  304. int  my_memcmp( text_ptr, text_ptr, int );
  305. /************************************************************************/
  306.  
  307.  
  308. /**********************  function prototypes in tab.c  ******************/
  309. int  tab_key( WINDOW * );
  310. int  backtab( WINDOW * );
  311. int  next_smart_tab( WINDOW * );
  312. int  prev_smart_tab( WINDOW * );
  313. text_ptr entab( text_ptr, int );
  314. void detab_linebuff( void );
  315. void entab_linebuff( void );
  316. text_ptr detab_a_line( text_ptr, int * );
  317. int  detab_adjust_rcol( text_ptr, int );
  318. int  entab_adjust_rcol( text_ptr, int, int );
  319. int  block_expand_tabs( WINDOW * );
  320. int  block_compress_tabs( WINDOW * );
  321. /************************************************************************/
  322.  
  323.  
  324. /*************************  function prototypes in utils.c **************/
  325. int  myiswhitespc( int );
  326. void check_virtual_col( WINDOW *, int, int );
  327. void copy_line( line_list_ptr );
  328. int  un_copy_line( line_list_ptr,  WINDOW * , int );
  329. int  un_copy_tab_buffer( line_list_ptr, WINDOW * );
  330. void load_undo_buffer( file_infos *, text_ptr, int );
  331. void set_prompt( char *, int );
  332. int  get_name( char *, int, char *, int );
  333. int  get_sort_order( WINDOW * );
  334. int  get_replace_direction( WINDOW * );
  335. int  get_yn( void );
  336. int  get_lr( void );
  337. int  get_bc( void );
  338. int  get_oa( void );
  339. void show_eof( WINDOW * );
  340. void display_current_window( WINDOW * );
  341. int  redraw_screen( WINDOW * );
  342. void redraw_current_window( WINDOW * );
  343. void show_changed_line( WINDOW * );
  344. void show_curl_line( WINDOW * );
  345. void dup_window_info( WINDOW *, WINDOW * );
  346. void adjust_windows_cursor( WINDOW *, long );
  347. int  first_non_blank( text_ptr, int );
  348. int  find_end( text_ptr, int );
  349. int  is_line_blank( text_ptr, int );
  350. int  page_up( WINDOW * );
  351. int  page_down( WINDOW * );
  352. int  scroll_down( WINDOW * );
  353. int  scroll_up( WINDOW * );
  354. int  pan_up( WINDOW * );
  355. int  pan_down( WINDOW * );
  356. void show_window_header( WINDOW * );
  357. void show_window_number_letter( WINDOW * );
  358. void show_window_fname( WINDOW * );
  359. void show_crlf_mode( WINDOW * );
  360. void show_size( WINDOW * );
  361. int  quit( WINDOW * );
  362. int  move_up( WINDOW * );
  363. int  move_down( WINDOW * );
  364. int  prepare_move_down( WINDOW * );
  365. int  move_left( WINDOW * );
  366. int  move_right( WINDOW * );
  367. int  pan_left( WINDOW * );
  368. int  pan_right( WINDOW * );
  369. int  word_left( WINDOW * );
  370. int  word_right( WINDOW * );
  371. int  next_dirty_line( WINDOW * );
  372. int  prev_dirty_line( WINDOW * );
  373. int  center_window( WINDOW * );
  374. int  horizontal_screen_right( WINDOW * );
  375. int  horizontal_screen_left( WINDOW * );
  376. int  goto_top_file( WINDOW * );
  377. int  goto_end_file( WINDOW * );
  378. int  goto_line( WINDOW * );
  379. int  set_marker( WINDOW * );
  380. int  goto_marker( WINDOW * );
  381. int  date_time_stamp( WINDOW * );
  382. int  add_chars( char *, WINDOW * );
  383. /************************************************************************/
  384.  
  385.  
  386. /*************************  function prototypes in window.c *************/
  387. int  initialize_window( void );
  388. void choose_window( char *, WINDOW * );
  389. int  next_window( WINDOW * );
  390. int  prev_window( WINDOW * );
  391. int  split_horizontal( WINDOW * );
  392. int  split_vertical( WINDOW * );
  393. void show_vertical_separator( WINDOW * );
  394. int  size_window( WINDOW * );
  395. int  zoom_window( WINDOW * );
  396. int  next_hidden_window( WINDOW * );
  397. void setup_window( WINDOW * );
  398. void finish( WINDOW * );
  399. int  create_window( WINDOW **, int, int, int, int, file_infos * );
  400. /************************************************************************/
  401.  
  402.  
  403. /**********************  function prototypes in wordwrap.c **************/
  404. int  find_left_margin( line_list_ptr, int );
  405. void word_wrap( WINDOW * );
  406. int  format_paragraph( WINDOW *window );
  407. void combine_wrap_spill( WINDOW *, int, int, int, int, int );
  408. void justify_right_margin( WINDOW *, line_list_ptr, int, int, int );
  409. void remove_spaces( int );
  410. int  find_word( text_ptr, int, int );
  411. int  flush_left( WINDOW * );
  412. int  flush_right( WINDOW * );
  413. int  flush_center( WINDOW * );
  414. /************************************************************************/
  415.  
  416.  
  417. /*************************  function prototypes in tdeasm.c *************/
  418. unsigned long  ptoul( void far * );
  419. text_ptr tabout( text_ptr, int * );
  420. /*****************************************************/
  421.  
  422.  
  423. /***********  function prototype for simul101.asm *************/
  424. void far simulate_enh_kbd( int );
  425. /*****************************************************/
  426.  
  427.  
  428. /***********  function prototype for criterr.asm *************/
  429. void far install_ceh( void far * );
  430. /*****************************************************/
  431.  
  432.  
  433. /***********  function prototype for criterr.c   *************/
  434. int  far crit_err_handler( void );
  435. void show_error_screen( int, int );
  436. void save_area( char far * );
  437. void restore_area( char far * );
  438. /*****************************************************/
  439.